package com.ruoyi.affiliatedSys.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.affiliatedSys.mapper.TbAffiliatedUnitMapper;
import com.ruoyi.affiliatedSys.domain.TbAffiliatedUnit;
import com.ruoyi.affiliatedSys.service.ITbAffiliatedUnitService;

/**
 * 依托与共建单位信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-07
 */
@Service
public class TbAffiliatedUnitServiceImpl implements ITbAffiliatedUnitService 
{
    @Autowired
    private TbAffiliatedUnitMapper tbAffiliatedUnitMapper;

    /**
     * 查询依托与共建单位信息
     * 
     * @param id 依托与共建单位信息主键
     * @return 依托与共建单位信息
     */
    @Override
    public TbAffiliatedUnit selectTbAffiliatedUnitById(Long id)
    {
        return tbAffiliatedUnitMapper.selectTbAffiliatedUnitById(id);
    }

    /**
     * 查询依托与共建单位信息列表
     * 
     * @param tbAffiliatedUnit 依托与共建单位信息
     * @return 依托与共建单位信息
     */
    @Override
    public List<TbAffiliatedUnit> selectTbAffiliatedUnitList(TbAffiliatedUnit tbAffiliatedUnit)
    {
        return tbAffiliatedUnitMapper.selectTbAffiliatedUnitList(tbAffiliatedUnit);
    }

    /**
     * 新增依托与共建单位信息
     * 
     * @param tbAffiliatedUnit 依托与共建单位信息
     * @return 结果
     */
    @Override
    public int insertTbAffiliatedUnit(TbAffiliatedUnit tbAffiliatedUnit)
    {
        tbAffiliatedUnit.setCreateTime(DateUtils.getNowDate());
        return tbAffiliatedUnitMapper.insertTbAffiliatedUnit(tbAffiliatedUnit);
    }

    /**
     * 修改依托与共建单位信息
     * 
     * @param tbAffiliatedUnit 依托与共建单位信息
     * @return 结果
     */
    @Override
    public int updateTbAffiliatedUnit(TbAffiliatedUnit tbAffiliatedUnit)
    {
        return tbAffiliatedUnitMapper.updateTbAffiliatedUnit(tbAffiliatedUnit);
    }

    /**
     * 批量删除依托与共建单位信息
     * 
     * @param ids 需要删除的依托与共建单位信息主键
     * @return 结果
     */
    @Override
    public int deleteTbAffiliatedUnitByIds(Long[] ids)
    {
        return tbAffiliatedUnitMapper.deleteTbAffiliatedUnitByIds(ids);
    }

    /**
     * 删除依托与共建单位信息信息
     * 
     * @param id 依托与共建单位信息主键
     * @return 结果
     */
    @Override
    public int deleteTbAffiliatedUnitById(Long id)
    {
        return tbAffiliatedUnitMapper.deleteTbAffiliatedUnitById(id);
    }
}
